package com.gcxy.controller;


import com.gcxy.conf.result.R;
import com.gcxy.entity.City;
import com.gcxy.service.CityService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 基础表-省市区 前端控制器
 * </p>
 *
 * @author jiang
 * @since 2023-12-21
 */
@Api(tags = "选择地址接口")
@RestController
@RequestMapping("/city")
public class CityController {

    @Autowired
    private CityService cityService;

    @ApiOperation("查询省份(直辖市)接口")
    @PostMapping("/getProvince")
    public R getProvince(@RequestBody City city){
        return cityService.getProvince(city);
    }

    @ApiOperation("查询市接口")
    @PostMapping("/getCity")
    public R getCity(@RequestBody City city){
        return cityService.getCity(city);
    }

    @ApiOperation("查询区县接口")
    @PostMapping("/getCounty")
    public R getCounty(@RequestBody City city){
        return cityService.getCounty(city);
    }
}

